/*#include <func.h>
#include <mysql/mysql.h>

typedef struct Client_info_s
{
    MYSQL *mysql;
    const char*host;
    const char*user;
    const char*passwd;
    const char*db; //具体的表（写死）
}Client_info;

//读表的操作:
typedef struct node_s {
    char data[1024];
    struct node_s *pNext;
} node_t;
typedef struct taskStack_s {
    node_t *pFront;
    int size;
} taskStack_t;
// init Stack
int initStack(taskStack_t *taskStack, char *path) {
    bzero(taskStack, sizeof(taskStack_t));
    node_t *pNew = (node_t *)calloc(1, sizeof(node_t));
    memcpy(pNew->data, path, sizeof(path));
    pNew->pNext = NULL;
    taskStack->pFront = pNew;
    ++taskStack->size;
    return 0;
}
int enStack(taskStack_t *taskStack, char *path) {
    node_t *pNew = (node_t *)calloc(1, sizeof(node_t));
    memcpy(&pNew->data, path, sizeof(path));
    pNew->pNext = taskStack->pFront;
    taskStack->pFront = pNew;
    ++taskStack->size;
    return 0;
}

int deStack(taskStack_t *taskStack) {
    node_t *pCur = taskStack->pFront;
    if(taskStack->size > 1) {
        taskStack->pFront = pCur->pNext;
        free(pCur);
        --taskStack->size;
    }
    return 0;
}
int visitStack(taskStack_t *taskStack, char *path) {
    char buf[1024];
    node_t *pCur = taskStack->pFront;

    strcpy(path, ""); // 初始化path为空字符串

    while (pCur) {
        strcpy(buf, pCur->data);
        strcat(buf, "/");
        strcat(buf, path);
        strcpy(path, buf);
        pCur = pCur->pNext;
    }

    // 去除末尾多余的斜杠
    if (strlen(path) > 0 && path[strlen(path) - 1] == '/') {
        path[strlen(path) - 1] = '\0';
    }
    return 0;
}

//需要UserName path Stack（返回值)--id
//int my_cd(const char*name,const char*path,)


/*int Mysql_init_my(MYSQL *mysql)
{
    mysql = mysql_init(NULL);
    MYSQL * ret = mysql_real_connect(mysql,"localhost","root",
                                     "123456","netdisk",
                                     0,NULL,0);
    if(ret == NULL){
        fprintf(stderr,"mysql_real_connect:%s\n", mysql_error(mysql));
        return -1;
    }    
}
*/
/*
int main(int argc, char *argv[])
{
    //创建栈
    taskStack_t taskStack;
    initStack(&taskStack, "1");

    MYSQL *mysql= mysql_init(NULL);
    MYSQL * ret = mysql_real_connect(mysql,"localhost","root",
                                     "123456","netdisk",
                                     0,NULL,0);
    if(ret == NULL){
        fprintf(stderr,"mysql_real_connect:%s\n", mysql_error(mysql));
        return -1;
    }
     
    char sql[] = "select id from file_info where filepath = '/dir2/file3' and user = 'zhangsan'";
    int qret = mysql_query(mysql,sql);
    if(qret != 0){
        fprintf(stderr,"mysql_query:%s\n",mysql_error(mysql));
        return -1;
    }
    //要获取行数
    MYSQL_RES *result = mysql_store_result(mysql);
    MYSQL_ROW row;
    row = mysql_fetch_row(result);
    if(row == 0)
    {
        printf("row is null\n");
    }
    //int id =atoi(row[0]);
    //printf("%d",id);
    enStack(&taskStack,row[0]);
    printf("%s\n",taskStack.pFront->data);
    //拿到这个 入栈

    return 0;
}*/

